<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>

<div class="back_to_top" id="top"></div>

<script type="text/javascript">
	$(".back_to_top").hide();
	
	//如果浏览器宽度改变，将“回到顶部”按钮放在最右边
	$(function () {
		$(window).resize(function() {
			var width = $(this).width();
			if (width >= 1000) {
				$(".back_to_top").css("right","200px");
			} else {
				$(".back_to_top").css("right","10px");
			}
		});
	});	
	
	$(function () {
		$(window).scroll(function () {
			if($(window).scrollTop() > 100) {
				$(".back_to_top").fadeIn(1000);
			} else {
				$(".back_to_top").fadeOut(1000);
			}
		});
	});
	
	//回到顶部
	$('#top').click(function(){
		  $('html,body').animate({scrollTop: '0px'}, 400);
		  return false;
	});
	
</script>